package net.devkit.core.pojo.db;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import net.devkit.core.pojo.DevCommandPOJO;


/**
 * The persistent class for the role database table.
 * 
 */
@Entity
@Table(name="role")
public class Role extends DevCommandPOJO<Role> {
	/**
	 * 
	 */
	private static final long serialVersionUID = -5418255418268531141L;
	private Long id;
	private Date crtDate;
	private Date mofDate;
	private String roleCode;
	private String roleDesc;
	private String roleName;
	private User user;

	public Role() {
	}
	
	public Role(Long id) {
		super();
		this.id = id;
	}



	@Id
	@Column(unique=true, nullable=false)
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}


	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="CRT_DATE")
	public Date getCrtDate() {
		return this.crtDate;
	}

	public void setCrtDate(Date crtDate) {
		this.crtDate = crtDate;
	}


	@Temporal(TemporalType.TIMESTAMP)
	public Date getMofDate() {
		return this.mofDate;
	}

	public void setMofDate(Date mofDate) {
		this.mofDate = mofDate;
	}


	@Column(name="ROLE_CODE", length=20)
	public String getRoleCode() {
		return this.roleCode;
	}

	public void setRoleCode(String roleCode) {
		this.roleCode = roleCode;
	}


	@Column(name="ROLE_DESC", length=200)
	public String getRoleDesc() {
		return this.roleDesc;
	}

	public void setRoleDesc(String roleDesc) {
		this.roleDesc = roleDesc;
	}


	@Column(name="ROLE_NAME", length=10)
	public String getRoleName() {
		return this.roleName;
	}

	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}


	//bi-directional many-to-one association to User
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="USER_ID")
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Override
	public int compareTo(Role o) {
		// TODO Auto-generated method stub
		return 0;
	}

}